#include <iostream>
#include <vector>

using std::cout;
using std::endl;
using std::vector;

void test()
{
    vector<int> number = {1, 4, 6, 8, 9, 10, 5, 7};

    cout << "vector的随机访问" << endl;
    cout << "number[1] = " << number[1] << endl;

    cout << endl << "在vector的尾部进行插入" << endl;
    number.push_back(22);
    number.push_back(33);

    for(auto &elem : number)
    {
        cout << elem << "  ";
    }
    cout << endl;

    cout << endl << "在vector的尾部进行删除" << endl;
    number.pop_back();
    for(auto &elem : number)
    {
        cout << elem << "  ";
    }
    cout << endl;
}

int main(int argc, char *argv[])
{
    test();
    return 0;
}

